package com.utyun.mqboot.controller;

import com.utyun.mqboot.service.KafkaProducerService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequiredArgsConstructor
@RequestMapping("/kafka")
@RestController
public class KafkaController {

    private final KafkaProducerService kafkaProducerService;

    @RequestMapping("/send")
    public String sendMessage(String message) {
        kafkaProducerService.sendMessage(message);
        return "发送成功";
    }

}
